#!/bin/bash

commands=(
  "ros2 run zorci move_joint_cmd"
  "ros2 run zorci move_joint_cmd 1 1 1 1 1 1 1"
  "ros2 run zorci move_pose_cmd"
  "ros2 run zorci move_line_cmd"
  "ros2 run zorci move_nullspace_cmd"
  "ros2 run zorci follow_traj_cmd"
  "ros2 run zorci follow_traj_cmd /home/zengyuhao/Downloads/traj2.txt"
)

loop_count=50  # 你想执行几次循环，改这个数

for ((i=1; i<=loop_count; i++)); do
  echo "=== Loop $i / $loop_count ==="
  for cmd in "${commands[@]}"; do
    echo "Running: $cmd"
    $cmd
    echo "Waiting 5 seconds..."
    sleep 5
  done
done

echo "All loops done."
